<?php
/**
 *	[站帮网复制加版权(zb7com_copyright.{modulename})] (C)2013-2099 Powered by 站帮网.
 *	Version: 1.0
 *	Date: 2013-11-14 16:14
 */

if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}
class plugin_zb7com_copyright {
	public static $plugin_config;
	//TODO - Insert your code here
	public function __construct(){
		global $_G;
		self::$plugin_config=$_G['cache']['plugin']['zb7com_copyright'];
		self::$plugin_config['unlimited_group']=dunserialize(self::$plugin_config['unlimited_group']);
		self::$plugin_config['area']=dunserialize(self::$plugin_config['area']);
		self::$plugin_config['forums']=dunserialize(self::$plugin_config['forums']);
	}
	
	public function global_footer(){
		global $_G;
		
		if($_G['uid']&&in_array($_G['groupid'],self::$plugin_config['unlimited_group'])){
			return;
		}
		
		if(!in_array('all', self::$plugin_config['area'])&&!in_array(CURSCRIPT,self::$plugin_config['area'])){
			return;
		}
		
		if(CURSCRIPT=='forum'&&!in_array($_G['fid'],self::$plugin_config['forums'])){
			return;
		}
		
		$res=array(
			'{url}'=>"'+url+'",
			'{title}'=>"'+title+'",
			'{bbname}'=>$_G['setting']['bbname'],
			'{siteurl}'=>$_G['siteurl']
		);

		$copyright=str_replace("'",'\\\'',$copyright);
		//$copyright=str_replace('"','\\"',$copyright);
		$copyright=str_replace(array_keys($res),$res,self::$plugin_config['copyright']);
		$copyright=preg_replace('/[\r\n]{1,2}/', '\r\n', $copyright);
	
		include template('zb7com_copyright:copyright');
		
		return $return;
	}
}

?>